package ${packageName}.${moduleName}.service.impl;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.rd.p2p.common.model.jpa.PageDataList;
import com.rd.p2p.common.model.jpa.QueryParam;
import ${packageName}.${moduleName}.dao.${ClassName}Dao;
import ${packageName}.${moduleName}.domain.${ClassName};
import ${packageName}.${moduleName}.service.${ClassName}Service;

/**
 * ${functionName}Service
 * TODO
 * @author ${classAuthor}
 * @version 2.0
 * @since ${classDate}
 */
@Service(value = "${className}Service")
@Transactional
public class ${ClassName}ServiceImpl implements ${ClassName}Service {
    
    @Resource
    private ${ClassName}Dao ${className}Dao;

    @Override
    public ${ClassName} add${ClassName}(${ClassName} ${className}) {
       return ${className}Dao.save(${className});

    }

    @Override
    public ${ClassName} get${ClassName}ById(long id) {
        return ${className}Dao.get${ClassName}ById(id);
    }

    @Override
    public ${ClassName} ${className}Update(${ClassName} ${className}) {
        return  ${className}Dao.update(${className});

    }

    @Override
    public void delete${ClassName}(long id) {
        ${className}Dao.delete(id);
    }

    @Override
    public PageDataList<${ClassName}> get${ClassName}PageList(QueryParam param) {
        return ${className}Dao.findPageList(param);
    }
}
